package top.guinguo.poker;

/**
 * Created by guin_guo on 2016/9/7.
 */
public class Poker {

    /**
     * 名称，A,1，J这些
     */
    private String name;

    /**
     * 大小 1，2，0.5这些
     */
    private double point;

    /**
     * 花色，使用枚举类，如下定义
     */
    private Color color;

    public enum Color {
        club("梅花"),heart("红桃"),diamand("方块"), spade("黑桃");
        private String zh;

        Color(String zh) {
            this.zh = zh;
        }

        public String getZh() {
            return zh;
        }
    }

    public Poker(String name, Color color,double point) {
        this.point = point;
        this.name = name;
        this.color = color;
    }

    public double getPoint() {
        return point;
    }

    public void setPoint(double point) {
        this.point = point;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return this.color.getZh() + " " + this.name + "(" + this.point + "点)";
    }

    public static void main(String[] args) {
        for (Color c : Color.values()) {
            System.out.println(c);
            System.out.println(c.getZh());
        }
    }
}
